﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

using GameEngine;
using GameEngine.Graphics;
using GameEngine.Graphics.Light;

namespace GameEngine
{
    class Gegner
    {
        Texture2D Back, Front;
        Vector2 Position;
        int Leben;

        public Gegner(ContentManager Content,Vector2 postion)
        {
            Back = Content.Load<Texture2D>(@"Gegner\Eins\Enemy1-Ground");
            Front = Content.Load<Texture2D>(@"Gegner\Eins\Enemy1-Body");
            Position = postion;
        }

        public void Update()
        {

        }

        public void Draw(Vector2 Spieler)
        {
            //Vector2 A = Spieler;
            //Vector2 vNewA = Position + Input.Movement;

            //float r = ((vNewA.X - A.X) > 0 ? 1 : -1) *
            //        (float)Math.Acos((double)Vector2.Dot(Vector2.Normalize(A),
            //                                                              Vector2.Normalize(vNewA)));

            Camera.TryDraw(Back, Position, null, Color.White, 0f, Vector2.Zero, 0.5f, SpriteEffects.None, 0f);
            Camera.TryDraw(Front, Position, null, Color.White,(float) 0f, Vector2.Zero, 0.5f, SpriteEffects.None, 0f);
        }

        public void DrawShadows(LightArea LA)
        {
            Camera.TryDraw(Back, LA.ToRelativePosition(Position), null, Color.White, 0f, Vector2.Zero, 0.5f, SpriteEffects.None, 0f);
        }
    }
}
